<template>
	<view class="wrap">
		<scroll-view class="scroll-list" scroll-y="true">
      
      <view class="search">
      	<u-search v-model="keywords" @custom="search" @search="search"></u-search>
      </view>
			<view class="uni-list">

        <view  v-for="(item, index) in messageList" :key="index" >
          
          <u-card :full="true"  :redbadge="item.status == 0" :title="title(item.messageTitle)" :sub-title="item.createTime"  padding="20" margin="0rpx 20rpx" thumb="/static/iconfont/countdown.png" @click="messageUrl(item)" :headBorderBottom='false'>
          	<view class="" slot="body">
          		<view class="u-body-item u-flex  u-col-between u-p-t-0">
          			<view class="u-body-item-title u-line-2">{{item.sendName}}学员于{{item.createTime}}提交了请假申请,请及时进入【请假申请】栏目进行审批</view>
          		</view>
          	</view>
          
          </u-card>
          
          
          
        </view>
        <u-card :full="true" title="用户分享内容到社交媒体或好友" sub-title="11月08日" padding="20" margin="0rpx 20rpx" thumb="/static/iconfont/countdown.png" @click="navTo('/pages/sys/msg/form')">
        	<view class="" slot="body">
        		<view class="u-body-item u-flex  u-col-between u-p-t-0">
        			<view class="u-body-item-title u-line-2">在常用的社交分享组件中，微信（微信好友和朋友圈）、微博、QQ（QQ好友和QQ空间）是三大主要平台 ...</view>
        		</view>
        	</view>

        </u-card>
        <u-card :full="true" title="用户分享内容到社交媒体或好友" sub-title="11月08日" padding="20" margin="0rpx 20rpx" thumb="/static/iconfont/notices.png" @click="navTo('/pages/sys/msg/form')">
        	<view class="" slot="body">
        		<view class="u-body-item u-flex  u-col-between u-p-t-0">
        			<view class="u-body-item-title u-line-2">在常用的社交分享组件中，微信（微信好友和朋友圈）、微博、QQ（QQ好友和QQ空间）是三大主要平台 ...</view>
        		</view>
        	</view>
        
        </u-card>


			</view>
		</scroll-view>
	</view>
</template>
<script>
/**
 * Copyright (c) 2013-Now http://aidex.vip All rights reserved.
 */
export default {
	data() {
		return {
			keywords: '',
			messageList:[],
      keywordss: {
        "name": "name",
          "namse": "nasme",
        
        
        
      },
						
		};
	},
	onLoad() {

	},
  onShow() {
		this.$u.api.getTeacherMessage({
     recid:this.vuex_user.userId
    }).then(response => {
         this.messageList=response.data
		})
  },
	methods: {
    
    title(type){
      if(type == "1"){
        return "老师点名提醒"
      }
      else if(type == "2"){
        return "请假申请通知"
      }
      
      
    },
    
    messageUrl(item){
      if(item.messageTitle == "1"){
        uni.navigateTo({
        	url: url
        });
      }
      else if(item.messageTitle == "2"){
        uni.navigateTo({
        	url: '/pages/sys/msg/details?data='+JSON.stringify(item)
        });
      }
      
      
    },

		navTo(url) {
			uni.navigateTo({
				url: url
			});
		},
		search(value) {
			this.$u.toast('搜索内容为：' + value)
		}
		
	}
};

</script>
<style lang="scss">
@import '../../../common/uni.css';
page {
	background-color: #f5f5f5;
}
.wrap .search{
	background: #ffffff;
}
.uni-title{
	font-size: 30rpx;
	color: #333333;
	padding: 10px;
	background: #fff;
	border-top:1px solid #ededed;
	margin-top: 20rpx;
}
.uni-media-list {
    padding: 15px 15px;

}
.uni-media-list-body {
    height: 42px;
	padding-left:20rpx;
}
.uni-media-list-text-top{
	height: 40rpx;
    overflow: hidden;
	width: 100%;
	line-height: 40rpx;
	font-size: 32rpx;
	display: flex;
	justify-content: space-between;
}

.uni-media-list-text-bottom {
    width: 100%;
    line-height: 24rpx;
    font-size: 26rpx;
	color: #666666;
	span{
		margin-right: 10rpx;
	}
}


</style>
